package cn.smileyan.demo;

import lombok.extern.slf4j.Slf4j;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.common.functions.RichFlatMapFunction;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.util.Collector;

/**
 *
 * @author Smileyan
 */
@Slf4j
public class WordCountRichFlatMapFunction extends RichFlatMapFunction<Tuple2<String, Integer>, Tuple2<String, Integer>> {
    @Override
    public void open(Configuration parameters) throws Exception {
        super.open(parameters);
        log.info("open");
    }

    @Override
    public void close() throws Exception {
        super.close();
        log.info("close");
    }

    @Override
    public void flatMap(Tuple2<String, Integer> value, Collector<Tuple2<String, Integer>> out) throws Exception {
        log.info("calculate");
    }
}
